//
//  PLYearMonthPicker.h
//
//  Created by KimmanYip on 2018/3/15.
//

#import <UIKit/UIKit.h>

@protocol PLYearMonthPickerDelegate;
@interface PLYearMonthPicker : UIView

@property (nonatomic, weak) id<PLYearMonthPickerDelegate> delegate;


/**
 默认选中时间，格式yyyy-MM，如：2018-06
 默认为当前月份
 */
@property (nonatomic, copy) NSString *defaultDate;

// 默认格式为yyyy-MM
- (instancetype)initWithCompletion:(void(^)(NSString *dateString))completion;

- (instancetype)initWithMinDate:(NSDate *)minDate maxDate:(NSDate *)maxDate completion:(void(^)(NSString *))completion;

- (instancetype)initWithFormatter:(NSString *)formatter completion:(void(^)(NSString *))completion;

- (void)show;


@end

@protocol PLYearMonthPickerDelegate <NSObject>

@optional
- (void)yearMonthPickerDidSelectYear:(NSInteger)year month:(NSInteger)month;

@end
